package com.company.common.function.webservice.client2.write;

import com.company.common.function.webservice.service2.HelloWorlds;
import com.company.common.function.webservice.service2.User;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

public class HelloWorldClient {
    /**
     * @param args
     */
    public static void main(String[] args) {

        //首先右键run as 运行com.hsy.server.webServiceApp类，然后再运行这段客户端代码
        JaxWsProxyFactoryBean jwpfb = new JaxWsProxyFactoryBean();
        jwpfb.setServiceClass(HelloWorlds.class);
        jwpfb.setAddress("http://localhost:8080/helloWorld");
        HelloWorlds hw = (HelloWorlds) jwpfb.create();
        User user = new User();
        user.setName("马克思");
        user.setEmail("怀念马克思");
        System.out.println(hw.sayHiToUser(user) + "成功");

    }
}
